﻿$(document).ready(function() {
    // ---------- TreeView --------------------------
    $(function() {
        $("#tree").treeview({
            collapsed: true,
            animated: "medium",
            persist: "location"
        });
    })
    // ---------- iFrame Auto Height --------------------------
    $("#PdtiFrame").load(function() {
        for (i = 0; i <= 2; i++) {
            if ($.browser.msie) {
                h = $("#PdtiFrame").contents().find("body").height() + 100;
                x = window.parent.$("#SJSiFrame").contents().find("body").height() + 50;
            }
            else {
                h = $("#PdtiFrame").contents().find("html").height() + 50;
                x = window.parent.$('#SJSiFrame').contents().find("html").height() + 50;
            }
            window.parent.$("#SJSiFrame").css({ "height": Math.max(h, x) + "px" });
            window.parent.$("#Mid").css({ "height": Math.max(h, x) + "px" });
            window.parent.$("#MidH").css({ "height": Math.max(h, x) + 30 + "px" }); ;
            $("#PdtiFrame").css({ "height": h + "px" });
        }
    });

});